↳ Prolog
↳ PrologToPiTRSProof
shanoi_in(s(s(X)), A, B, C, M) → U1(X, A, B, C, M, eq_in(N1, s(X)))
eq_in(X, X) → eq_out(X, X)
U1(X, A, B, C, M, eq_out(N1, s(X))) → U2(X, A, B, C, M, N1, shanoi_in(N1, A, C, B, M1))
shanoi_in(s(0), A, B, C, .(mv(A, C), [])) → shanoi_out(s(0), A, B, C, .(mv(A, C), []))
U2(X, A, B, C, M, N1, shanoi_out(N1, A, C, B, M1)) → U3(X, A, B, C, M, M1, shanoi_in(N1, B, A, C, M2))
U3(X, A, B, C, M, M1, shanoi_out(N1, B, A, C, M2)) → U4(X, A, B, C, M, M2, append_in(M1, .(mv(A, C), []), T))
append_in(.(H, L), L1, .(H, R)) → U6(H, L, L1, R, append_in(L, L1, R))
append_in([], L, L) → append_out([], L, L)
U6(H, L, L1, R, append_out(L, L1, R)) → append_out(.(H, L), L1, .(H, R))
U4(X, A, B, C, M, M2, append_out(M1, .(mv(A, C), []), T)) → U5(X, A, B, C, M, append_in(T, M2, M))
U5(X, A, B, C, M, append_out(T, M2, M)) → shanoi_out(s(s(X)), A, B, C, M)
Infinitary Constructor Rewriting Termination of PiTRS implies Termination of Prolog
↳ Prolog
↳ PrologToPiTRSProof
↳ PiTRS
↳ DependencyPairsProof
shanoi_in(s(s(X)), A, B, C, M) → U1(X, A, B, C, M, eq_in(N1, s(X)))
eq_in(X, X) → eq_out(X, X)
U1(X, A, B, C, M, eq_out(N1, s(X))) → U2(X, A, B, C, M, N1, shanoi_in(N1, A, C, B, M1))
shanoi_in(s(0), A, B, C, .(mv(A, C), [])) → shanoi_out(s(0), A, B, C, .(mv(A, C), []))
U2(X, A, B, C, M, N1, shanoi_out(N1, A, C, B, M1)) → U3(X, A, B, C, M, M1, shanoi_in(N1, B, A, C, M2))
U3(X, A, B, C, M, M1, shanoi_out(N1, B, A, C, M2)) → U4(X, A, B, C, M, M2, append_in(M1, .(mv(A, C), []), T))
append_in(.(H, L), L1, .(H, R)) → U6(H, L, L1, R, append_in(L, L1, R))
append_in([], L, L) → append_out([], L, L)
U6(H, L, L1, R, append_out(L, L1, R)) → append_out(.(H, L), L1, .(H, R))
U4(X, A, B, C, M, M2, append_out(M1, .(mv(A, C), []), T)) → U5(X, A, B, C, M, append_in(T, M2, M))
U5(X, A, B, C, M, append_out(T, M2, M)) → shanoi_out(s(s(X)), A, B, C, M)
SHANOI_IN(s(s(X)), A, B, C, M) → U11(X, A, B, C, M, eq_in(N1, s(X)))
SHANOI_IN(s(s(X)), A, B, C, M) → EQ_IN(N1, s(X))
U11(X, A, B, C, M, eq_out(N1, s(X))) → U21(X, A, B, C, M, N1, shanoi_in(N1, A, C, B, M1))
U11(X, A, B, C, M, eq_out(N1, s(X))) → SHANOI_IN(N1, A, C, B, M1)
U21(X, A, B, C, M, N1, shanoi_out(N1, A, C, B, M1)) → U31(X, A, B, C, M, M1, shanoi_in(N1, B, A, C, M2))
U21(X, A, B, C, M, N1, shanoi_out(N1, A, C, B, M1)) → SHANOI_IN(N1, B, A, C, M2)
U31(X, A, B, C, M, M1, shanoi_out(N1, B, A, C, M2)) → U41(X, A, B, C, M, M2, append_in(M1, .(mv(A, C), []), T))
U31(X, A, B, C, M, M1, shanoi_out(N1, B, A, C, M2)) → APPEND_IN(M1, .(mv(A, C), []), T)
APPEND_IN(.(H, L), L1, .(H, R)) → U61(H, L, L1, R, append_in(L, L1, R))
APPEND_IN(.(H, L), L1, .(H, R)) → APPEND_IN(L, L1, R)
U41(X, A, B, C, M, M2, append_out(M1, .(mv(A, C), []), T)) → U51(X, A, B, C, M, append_in(T, M2, M))
U41(X, A, B, C, M, M2, append_out(M1, .(mv(A, C), []), T)) → APPEND_IN(T, M2, M)
shanoi_in(s(s(X)), A, B, C, M) → U1(X, A, B, C, M, eq_in(N1, s(X)))
eq_in(X, X) → eq_out(X, X)
U1(X, A, B, C, M, eq_out(N1, s(X))) → U2(X, A, B, C, M, N1, shanoi_in(N1, A, C, B, M1))
shanoi_in(s(0), A, B, C, .(mv(A, C), [])) → shanoi_out(s(0), A, B, C, .(mv(A, C), []))
U2(X, A, B, C, M, N1, shanoi_out(N1, A, C, B, M1)) → U3(X, A, B, C, M, M1, shanoi_in(N1, B, A, C, M2))
U3(X, A, B, C, M, M1, shanoi_out(N1, B, A, C, M2)) → U4(X, A, B, C, M, M2, append_in(M1, .(mv(A, C), []), T))
append_in(.(H, L), L1, .(H, R)) → U6(H, L, L1, R, append_in(L, L1, R))
append_in([], L, L) → append_out([], L, L)
U6(H, L, L1, R, append_out(L, L1, R)) → append_out(.(H, L), L1, .(H, R))
U4(X, A, B, C, M, M2, append_out(M1, .(mv(A, C), []), T)) → U5(X, A, B, C, M, append_in(T, M2, M))
U5(X, A, B, C, M, append_out(T, M2, M)) → shanoi_out(s(s(X)), A, B, C, M)
↳ Prolog
↳ PrologToPiTRSProof
↳ PiTRS
↳ DependencyPairsProof
↳ PiDP
↳ DependencyGraphProof
SHANOI_IN(s(s(X)), A, B, C, M) → U11(X, A, B, C, M, eq_in(N1, s(X)))
SHANOI_IN(s(s(X)), A, B, C, M) → EQ_IN(N1, s(X))
U11(X, A, B, C, M, eq_out(N1, s(X))) → U21(X, A, B, C, M, N1, shanoi_in(N1, A, C, B, M1))
U11(X, A, B, C, M, eq_out(N1, s(X))) → SHANOI_IN(N1, A, C, B, M1)
U21(X, A, B, C, M, N1, shanoi_out(N1, A, C, B, M1)) → U31(X, A, B, C, M, M1, shanoi_in(N1, B, A, C, M2))
U21(X, A, B, C, M, N1, shanoi_out(N1, A, C, B, M1)) → SHANOI_IN(N1, B, A, C, M2)
U31(X, A, B, C, M, M1, shanoi_out(N1, B, A, C, M2)) → U41(X, A, B, C, M, M2, append_in(M1, .(mv(A, C), []), T))
U31(X, A, B, C, M, M1, shanoi_out(N1, B, A, C, M2)) → APPEND_IN(M1, .(mv(A, C), []), T)
APPEND_IN(.(H, L), L1, .(H, R)) → U61(H, L, L1, R, append_in(L, L1, R))
APPEND_IN(.(H, L), L1, .(H, R)) → APPEND_IN(L, L1, R)
U41(X, A, B, C, M, M2, append_out(M1, .(mv(A, C), []), T)) → U51(X, A, B, C, M, append_in(T, M2, M))
U41(X, A, B, C, M, M2, append_out(M1, .(mv(A, C), []), T)) → APPEND_IN(T, M2, M)
shanoi_in(s(s(X)), A, B, C, M) → U1(X, A, B, C, M, eq_in(N1, s(X)))
eq_in(X, X) → eq_out(X, X)
U1(X, A, B, C, M, eq_out(N1, s(X))) → U2(X, A, B, C, M, N1, shanoi_in(N1, A, C, B, M1))
shanoi_in(s(0), A, B, C, .(mv(A, C), [])) → shanoi_out(s(0), A, B, C, .(mv(A, C), []))
U2(X, A, B, C, M, N1, shanoi_out(N1, A, C, B, M1)) → U3(X, A, B, C, M, M1, shanoi_in(N1, B, A, C, M2))
U3(X, A, B, C, M, M1, shanoi_out(N1, B, A, C, M2)) → U4(X, A, B, C, M, M2, append_in(M1, .(mv(A, C), []), T))
append_in(.(H, L), L1, .(H, R)) → U6(H, L, L1, R, append_in(L, L1, R))
append_in([], L, L) → append_out([], L, L)
U6(H, L, L1, R, append_out(L, L1, R)) → append_out(.(H, L), L1, .(H, R))
U4(X, A, B, C, M, M2, append_out(M1, .(mv(A, C), []), T)) → U5(X, A, B, C, M, append_in(T, M2, M))
U5(X, A, B, C, M, append_out(T, M2, M)) → shanoi_out(s(s(X)), A, B, C, M)
↳ Prolog
↳ PrologToPiTRSProof
↳ PiTRS
↳ DependencyPairsProof
↳ PiDP
↳ DependencyGraphProof
↳ AND
↳ PiDP
↳ UsableRulesProof
↳ PiDP
APPEND_IN(.(H, L), L1, .(H, R)) → APPEND_IN(L, L1, R)
shanoi_in(s(s(X)), A, B, C, M) → U1(X, A, B, C, M, eq_in(N1, s(X)))
eq_in(X, X) → eq_out(X, X)
U1(X, A, B, C, M, eq_out(N1, s(X))) → U2(X, A, B, C, M, N1, shanoi_in(N1, A, C, B, M1))
shanoi_in(s(0), A, B, C, .(mv(A, C), [])) → shanoi_out(s(0), A, B, C, .(mv(A, C), []))
U2(X, A, B, C, M, N1, shanoi_out(N1, A, C, B, M1)) → U3(X, A, B, C, M, M1, shanoi_in(N1, B, A, C, M2))
U3(X, A, B, C, M, M1, shanoi_out(N1, B, A, C, M2)) → U4(X, A, B, C, M, M2, append_in(M1, .(mv(A, C), []), T))
append_in(.(H, L), L1, .(H, R)) → U6(H, L, L1, R, append_in(L, L1, R))
append_in([], L, L) → append_out([], L, L)
U6(H, L, L1, R, append_out(L, L1, R)) → append_out(.(H, L), L1, .(H, R))
U4(X, A, B, C, M, M2, append_out(M1, .(mv(A, C), []), T)) → U5(X, A, B, C, M, append_in(T, M2, M))
U5(X, A, B, C, M, append_out(T, M2, M)) → shanoi_out(s(s(X)), A, B, C, M)
↳ Prolog
↳ PrologToPiTRSProof
↳ PiTRS
↳ DependencyPairsProof
↳ PiDP
↳ DependencyGraphProof
↳ AND
↳ PiDP
↳ UsableRulesProof
↳ PiDP
↳ PiDPToQDPProof
↳ PiDP
APPEND_IN(.(H, L), L1, .(H, R)) → APPEND_IN(L, L1, R)
↳ Prolog
↳ PrologToPiTRSProof
↳ PiTRS
↳ DependencyPairsProof
↳ PiDP
↳ DependencyGraphProof
↳ AND
↳ PiDP
↳ UsableRulesProof
↳ PiDP
↳ PiDPToQDPProof
↳ QDP
↳ QDPSizeChangeProof
↳ PiDP
APPEND_IN(.(H, L), L1) → APPEND_IN(L, L1)
From the DPs we obtained the following set of size-change graphs:
↳ Prolog
↳ PrologToPiTRSProof
↳ PiTRS
↳ DependencyPairsProof
↳ PiDP
↳ DependencyGraphProof
↳ AND
↳ PiDP
↳ PiDP
↳ PiDPToQDPProof
SHANOI_IN(s(s(X)), A, B, C, M) → U11(X, A, B, C, M, eq_in(N1, s(X)))
U11(X, A, B, C, M, eq_out(N1, s(X))) → SHANOI_IN(N1, A, C, B, M1)
U21(X, A, B, C, M, N1, shanoi_out(N1, A, C, B, M1)) → SHANOI_IN(N1, B, A, C, M2)
U11(X, A, B, C, M, eq_out(N1, s(X))) → U21(X, A, B, C, M, N1, shanoi_in(N1, A, C, B, M1))
shanoi_in(s(s(X)), A, B, C, M) → U1(X, A, B, C, M, eq_in(N1, s(X)))
eq_in(X, X) → eq_out(X, X)
U1(X, A, B, C, M, eq_out(N1, s(X))) → U2(X, A, B, C, M, N1, shanoi_in(N1, A, C, B, M1))
shanoi_in(s(0), A, B, C, .(mv(A, C), [])) → shanoi_out(s(0), A, B, C, .(mv(A, C), []))
U2(X, A, B, C, M, N1, shanoi_out(N1, A, C, B, M1)) → U3(X, A, B, C, M, M1, shanoi_in(N1, B, A, C, M2))
U3(X, A, B, C, M, M1, shanoi_out(N1, B, A, C, M2)) → U4(X, A, B, C, M, M2, append_in(M1, .(mv(A, C), []), T))
append_in(.(H, L), L1, .(H, R)) → U6(H, L, L1, R, append_in(L, L1, R))
append_in([], L, L) → append_out([], L, L)
U6(H, L, L1, R, append_out(L, L1, R)) → append_out(.(H, L), L1, .(H, R))
U4(X, A, B, C, M, M2, append_out(M1, .(mv(A, C), []), T)) → U5(X, A, B, C, M, append_in(T, M2, M))
U5(X, A, B, C, M, append_out(T, M2, M)) → shanoi_out(s(s(X)), A, B, C, M)
↳ Prolog
↳ PrologToPiTRSProof
↳ PiTRS
↳ DependencyPairsProof
↳ PiDP
↳ DependencyGraphProof
↳ AND
↳ PiDP
↳ PiDP
↳ PiDPToQDPProof
↳ QDP
↳ Rewriting
U11(A, B, C, eq_out(N1)) → U21(A, B, C, N1, shanoi_in(N1, A, C, B))
U21(A, B, C, N1, shanoi_out(M1)) → SHANOI_IN(N1, B, A, C)
SHANOI_IN(s(s(X)), A, B, C) → U11(A, B, C, eq_in(s(X)))
U11(A, B, C, eq_out(N1)) → SHANOI_IN(N1, A, C, B)
shanoi_in(s(s(X)), A, B, C) → U1(A, B, C, eq_in(s(X)))
eq_in(X) → eq_out(X)
U1(A, B, C, eq_out(N1)) → U2(A, B, C, N1, shanoi_in(N1, A, C, B))
shanoi_in(s(0), A, B, C) → shanoi_out(.(mv(A, C), []))
U2(A, B, C, N1, shanoi_out(M1)) → U3(A, C, M1, shanoi_in(N1, B, A, C))
U3(A, C, M1, shanoi_out(M2)) → U4(M2, append_in(M1, .(mv(A, C), [])))
append_in(.(H, L), L1) → U6(H, append_in(L, L1))
append_in([], L) → append_out(L)
U6(H, append_out(R)) → append_out(.(H, R))
U4(M2, append_out(T)) → U5(append_in(T, M2))
U5(append_out(M)) → shanoi_out(M)
shanoi_in(x0, x1, x2, x3)
eq_in(x0)
U1(x0, x1, x2, x3)
U2(x0, x1, x2, x3, x4)
U3(x0, x1, x2, x3)
append_in(x0, x1)
U6(x0, x1)
U4(x0, x1)
U5(x0)
SHANOI_IN(s(s(X)), A, B, C) → U11(A, B, C, eq_out(s(X)))
↳ Prolog
↳ PrologToPiTRSProof
↳ PiTRS
↳ DependencyPairsProof
↳ PiDP
↳ DependencyGraphProof
↳ AND
↳ PiDP
↳ PiDP
↳ PiDPToQDPProof
↳ QDP
↳ Rewriting
↳ QDP
↳ QDPOrderProof
U11(A, B, C, eq_out(N1)) → U21(A, B, C, N1, shanoi_in(N1, A, C, B))
U21(A, B, C, N1, shanoi_out(M1)) → SHANOI_IN(N1, B, A, C)
U11(A, B, C, eq_out(N1)) → SHANOI_IN(N1, A, C, B)
SHANOI_IN(s(s(X)), A, B, C) → U11(A, B, C, eq_out(s(X)))
shanoi_in(s(s(X)), A, B, C) → U1(A, B, C, eq_in(s(X)))
eq_in(X) → eq_out(X)
U1(A, B, C, eq_out(N1)) → U2(A, B, C, N1, shanoi_in(N1, A, C, B))
shanoi_in(s(0), A, B, C) → shanoi_out(.(mv(A, C), []))
U2(A, B, C, N1, shanoi_out(M1)) → U3(A, C, M1, shanoi_in(N1, B, A, C))
U3(A, C, M1, shanoi_out(M2)) → U4(M2, append_in(M1, .(mv(A, C), [])))
append_in(.(H, L), L1) → U6(H, append_in(L, L1))
append_in([], L) → append_out(L)
U6(H, append_out(R)) → append_out(.(H, R))
U4(M2, append_out(T)) → U5(append_in(T, M2))
U5(append_out(M)) → shanoi_out(M)
shanoi_in(x0, x1, x2, x3)
eq_in(x0)
U1(x0, x1, x2, x3)
U2(x0, x1, x2, x3, x4)
U3(x0, x1, x2, x3)
append_in(x0, x1)
U6(x0, x1)
U4(x0, x1)
U5(x0)
The following pairs can be oriented strictly and are deleted.
The remaining pairs can at least be oriented weakly.
SHANOI_IN(s(s(X)), A, B, C) → U11(A, B, C, eq_out(s(X)))
Used ordering: Polynomial interpretation [25]:
U11(A, B, C, eq_out(N1)) → U21(A, B, C, N1, shanoi_in(N1, A, C, B))
U21(A, B, C, N1, shanoi_out(M1)) → SHANOI_IN(N1, B, A, C)
U11(A, B, C, eq_out(N1)) → SHANOI_IN(N1, A, C, B)
POL(.(x1, x2)) = 0
POL(0) = 0
POL(SHANOI_IN(x1, x2, x3, x4)) = x1
POL(U1(x1, x2, x3, x4)) = 0
POL(U11(x1, x2, x3, x4)) = x4
POL(U2(x1, x2, x3, x4, x5)) = 0
POL(U21(x1, x2, x3, x4, x5)) = x4
POL(U3(x1, x2, x3, x4)) = 0
POL(U4(x1, x2)) = 0
POL(U5(x1)) = 0
POL(U6(x1, x2)) = 1
POL([]) = 1
POL(append_in(x1, x2)) = 1 + x1 + x2
POL(append_out(x1)) = 1
POL(eq_in(x1)) = 0
POL(eq_out(x1)) = x1
POL(mv(x1, x2)) = 0
POL(s(x1)) = 1 + x1
POL(shanoi_in(x1, x2, x3, x4)) = 0
POL(shanoi_out(x1)) = 0
↳ Prolog
↳ PrologToPiTRSProof
↳ PiTRS
↳ DependencyPairsProof
↳ PiDP
↳ DependencyGraphProof
↳ AND
↳ PiDP
↳ PiDP
↳ PiDPToQDPProof
↳ QDP
↳ Rewriting
↳ QDP
↳ QDPOrderProof
↳ QDP
↳ DependencyGraphProof
U11(A, B, C, eq_out(N1)) → U21(A, B, C, N1, shanoi_in(N1, A, C, B))
U21(A, B, C, N1, shanoi_out(M1)) → SHANOI_IN(N1, B, A, C)
U11(A, B, C, eq_out(N1)) → SHANOI_IN(N1, A, C, B)
shanoi_in(s(s(X)), A, B, C) → U1(A, B, C, eq_in(s(X)))
eq_in(X) → eq_out(X)
U1(A, B, C, eq_out(N1)) → U2(A, B, C, N1, shanoi_in(N1, A, C, B))
shanoi_in(s(0), A, B, C) → shanoi_out(.(mv(A, C), []))
U2(A, B, C, N1, shanoi_out(M1)) → U3(A, C, M1, shanoi_in(N1, B, A, C))
U3(A, C, M1, shanoi_out(M2)) → U4(M2, append_in(M1, .(mv(A, C), [])))
append_in(.(H, L), L1) → U6(H, append_in(L, L1))
append_in([], L) → append_out(L)
U6(H, append_out(R)) → append_out(.(H, R))
U4(M2, append_out(T)) → U5(append_in(T, M2))
U5(append_out(M)) → shanoi_out(M)
shanoi_in(x0, x1, x2, x3)
eq_in(x0)
U1(x0, x1, x2, x3)
U2(x0, x1, x2, x3, x4)
U3(x0, x1, x2, x3)
append_in(x0, x1)
U6(x0, x1)
U4(x0, x1)
U5(x0)